package com.zhongkai.service.book;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;
import com.zhongkai.model.book.TXtXxts;
import com.zhongkai.service.CommonService;
@Component
public class ReadMessageService extends CommonService{

	/**
	 * 根据收件人的代码，寻找他对应的未查看的信息,将记录集合和记录总数存放到session对象中
	 * @param sjrDm
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public void getNotReadMessages(String sjrDm,HttpServletRequest request) throws Exception{		
		int message_count=0;
		List<TXtXxts> tXtXxts=this.findByColumns("TXtXxts", new String[]{"sjrDm","zt"}, new String[]{sjrDm,"N"});
		if(tXtXxts!=null){
			message_count=tXtXxts.size();
		}
		request.getSession().setAttribute("count",message_count);
		request.getSession().setAttribute("messages",tXtXxts);
	}
	

	

}
